<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        
        function jsonp(url, callback) {
            var head = document.getElementsByTagName('head')[0]
            var jsonp = document.createElement('script')
            jsonp.src = url
            head.append(jsonp)
        }
        jsonp('http://localhost:3000/data?callback=callback', callback = (res) => {
          console.log(res);
        })
        
        function callback(a) {
            console.log(a);
        }

    </script>
</body>
</html>